﻿@{
    ViewBag.Title = "Album";
    Layout = "~/Views/Shared/_ViewFormPage.cshtml";
}
@section head{

    <script type="text/javascript">
        
        $(function() {
            $("#btnSave").on("click", save);
        });

        function save() {
            if ($("form").valid()) {
                $('form').ajaxSubmit({
                    type: "Post",
                    beforeSubmit: function () {
                        $("#btnSave").off("click", save);
                    },
                    success: function (callback) {
                        if (callback) {
                            $.ligerDialog.success('保存成功', function (yes) {
                                self.location.href = "/Company/Albums";
                            });
                        }
                        else {
                            $("#btnSave").on("click", save);
                            $.ligerDialog.error('保存失败');
                            $("#btnSave").on("click", save);
                        }
                    },
                    error: function (ex) {
                        $("#btnSave").on("click", save);
                        $.ligerDialog.error('保存失败');
                    }
                });
            }
        }
    </script>
}
@model AlbumVM
<div id="header" class="header">
    <h4>内容管理 -- 维护</h4>
</div>
@using (Html.BeginForm("Album", "Company", FormMethod.Post))
{
    @Html.HiddenFor(model => model.AlbumId)
    <div id="detail_forms">
        <div class="formsItems clearfix">
            <div class="formItem labelItem">
                相册名称
            </div>
            <div class="formItem textItem">
                @Html.TextBoxFor(model => model.AlbumName, new { @class = "texts" })
            </div>
            <div class="formItem msgItem">
                *
            </div>
        </div>


        <div id="btnContainer" class="formsItems">
            <div class="formItem labelItem">
                &nbsp;
            </div>
            <div class="formItem textItem">
                <a href="javascript:void(0);" id="btnSave">保存</a>
                <a href="/Company/Albums" id="btnCancel">取消</a>
            </div>
            <div class="formItem">
            </div>
        </div>
        <div class="formsItems"></div>
    </div>
}


